package com.sky.mapper;

import com.sky.anno.AutoFill;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {
//   * 根据用户名查询员工
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    // 新增员工
    @AutoFill(value = OperationType.INSERT)
    void add(Employee employee);
    //条件分页查询
    List<Employee> findByPage(EmployeePageQueryDTO employeePageQueryDTO);
   //修改员工

    @AutoFill( value =OperationType.UPDATE)
    void update (Employee employee);
// 根据id查询员工
   Employee getinfoById(Long id);
}
